#pragma once
namespace graph
{
   namespace algorithm
   {  
      namespace details
      {
         enum astar_initializer_mode_e
         {
            nearest_edges,      //find nearest edges and init astar heep with them
            particular_vertices //take start and finish ids and init astar heep only with them
         };
         static size_t DIST_FINE = 5;
      }
      
      struct astar_initializer_t
      {
         astar_initializer_t(graph_view_t& view,
                             point_t start_p,
                             point_t finish_p)
            :  view_(view)
            ,  start_p_(start_p)
            ,  finish_p_(finish_p)
            ,  error_(0)
            ,  initializer_mode_(details::nearest_edges)
         {}
         
         astar_initializer_t(graph_view_t& view,
                             vertex_id_t start_vertex_id,
                             vertex_id_t finish_vertex_id)
            :  view_(view)
            ,  start_vertex_id_(start_vertex_id)
            ,  finish_vertex_id_(finish_vertex_id)
            ,  error_(0)
            ,  initializer_mode_(details::particular_vertices)
         {}
         
         template<mode_e mode, directional_e direction>
         void init_me(astar_search_t<mode, direction>& as);         
         int get_last_error();
         
      private:
         graph_view_t& view_;
         point_t start_p_;
         point_t finish_p_;
         vertex_id_t start_vertex_id_;
         vertex_id_t finish_vertex_id_;
         int error_;
         details::astar_initializer_mode_e initializer_mode_;
      };    
   }
}
